package com.ruoyi.shop.api.factory;

import com.ruoyi.shop.api.RemoteImageService;
import com.ruoyi.shop.api.RemoteOilService;
import com.ruoyi.shop.api.RemoteShopImageService;
import com.ruoyi.shop.api.domain.ChePetrolOil;
import com.ruoyi.shop.api.domain.PetrolImage;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;

import java.util.ArrayList;
import java.util.List;

/**
 * @ClassName RemoteOilFallbackFactory
 * @Description TODO
 * @Author mujiale
 * @Date 2025年01月06日 15:27
 * @Version 1.0
 */
@Component
public class RemoteImageFallbackFactory implements FallbackFactory<RemoteImageService> {

    private static final Logger log = LoggerFactory.getLogger(RemoteImageFallbackFactory.class);

    @Override
    public RemoteImageService create(Throwable throwable) {
        log.error("商户服务调用失败:{}", throwable.getMessage());
        return new RemoteImageService() {
            @Override
            public PetrolImage getInfo1(Long id, String source) {
                return new PetrolImage();
            }

            @Override
            public PetrolImage selectPetrolImageByPetrolId(Long id, String source) {
                return new PetrolImage();
            }

        };
    }
}
